#ifndef CRequestOrderInterface_H
#define REQUESTORDERWINDOW_H

#include <QMainWindow>
#include "mapprocess/mapprocessor.h"
#include "IInterface.h"
#include "socket/protocol/ClientBook.h"

namespace Ui {
    class RequestOrder;
}
namespace interface
{
class CRequestOrderInterface : public IInterface
{
    Q_OBJECT

public:
    explicit CRequestOrderInterface(IInterface *parent = 0);
    ~CRequestOrderInterface();

    enum ScreenOrientation {
        ScreenOrientationLockPortrait,
        ScreenOrientationLockLandscape,
        ScreenOrientationAuto
    };

    // Note that this will only have an effect on Symbian and Fremantle.
    void setOrientation(ScreenOrientation orientation);

    void showExpanded();

public Q_SLOTS:
    void RequestStart();
    void RequestReset(); //reset
    void RequestEnd(); //commit
    void setStartPosition(long lat,long lon);
    void setEndPostion(long lat,long lon);
    void CancelRequest(); //cancel

    // slots for socket notification
    void readResult();
    void socketError();

private:
    Ui::RequestOrder *ui;
    MapProcessor * mapProcessor;
    struct LatLon startPos;
    struct LatLon endPos;
    enum BookStatus {
        ChooseStart,
        ChooseEnd,
        ReadyToSubmit
    };
    BookStatus bookstatus;

    // used to book the taxi
    protocal::ClientBook *m_pClientBook;

private:
    void UiSetting(Ui::RequestOrder *ui);
};
}
#endif // REQUESTORDERWINDOW_H
